|
|
|
| Table 1.5 Constants for Using System-Defined Colors | | CONSTANT | VALUE | COLOR FOR: | | vbButtonShadow | &H80000010 | Command button edge shading | | vbGrayText | &H80000011 | Disabled text | | vbButtonText | &H80000012 | Command button text | | vblnactiveCaptionText | &H80000013 | Inactive caption text | | vb3DHighlight | &H80000014 | 3D object highlight | | vb3DDKShadow | &H80000015 | 3D object darkest shadow | | vb3DLight | &H80000016 | 3D object lightest color after vb3DHighlight | | vbInfoText | &H80000017 | ToolTips text | | vbInfoBackground | &H80000018 | ToolTips background |
|
|
|
|
|
|
Example program SysColor, shown in Figure 1.30, displays the system-defined colors currently set on your system. |
|
|
|
|
|
|
|
|
For a color stored in an RGB format, you can use the method described earlier to break the color into its red, green, and blue components. Some objects, however, use system color indexes instead of RGB colors. For example, a label control's BackColor property might have the value &H8000000F. |
|
|
|
|
|
|
|
|
In cases like this, you can remove the leftmost digit from this number and use the result as the input to the GetSysColor API function. This function returns the true color associated with a system color index. You can now use the method described earlier to break the color into its components. |
|
|
|
|
|
|
|
|
Figure 1.30
Example program SysColor displays the system-defined colors. |
|
|
|
|
|